package 第十章;
import java.io.*;
import java.util.*;
public class test3 {
    public static void main(String[] args) {
        try {
            File file = new File("test3.txt");
            Scanner scanner = new Scanner(file);
            scanner.useDelimiter("[^0123456789]+");
            int sum = 0, num = 0;
            while (scanner.hasNextInt()) {
                num++;
                int temp = scanner.nextInt();
                sum += temp;
            }
            System.out.println("平均价格是：" + sum * 1.0 / num);
        } catch (IOException e) {
            e.fillInStackTrace();
        }
    }

}
